#ifndef EQIBWEBPAGE_H
#define EQIBWEBPAGE_H

#include <QWebPage>
#include <QtNetwork/QNetworkAccessManager>
#include <QDesktopServices>
#include <QtNetwork/QNetworkDiskCache>
#include <QWebFrame>
#include <QPrinter>
#include <QAction>
#include <QMenu>
#include <QPrintDialog>
#include <QWebElement>
#include <QImage>
#include <QSize>
#include <QPainter>
#include <QTextDocument>
#include <QPrintPreviewDialog>
#include <QStandardPaths>
#include <eqibcontrol.h>
#include <QWebView>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QContextMenuEvent>
#include <QTimer>
#include <eqibutils.h>

class EQIBWebPage : public QWebPage
{
    Q_OBJECT
public:
    explicit EQIBWebPage(QWebView *webView,EQIBControl *c);
    ~EQIBWebPage();
    QWebPage * createWindow(WebWindowType type );
    QWebView *webView;


private:
    EQIBControl *c;
    QTimer *loadingTimer;
    int loadingIconIndex ;

    void closeEvent(QCloseEvent *event);
    void contextMenuEvent(QContextMenuEvent * ev );
    int findTabIndex();

signals:

public slots:
private slots:

    void onLoadingTimerTimeout();

    void unsupportedContent(QNetworkReply *reply);



    void on_webView_titleChanged(const QString &title);

    void on_webView_customContextMenuRequested(const QPoint &pos);

    void on_webView_iconChanged();

    void on_webView_loadFinished(bool arg1);

    void on_webView_loadStarted();

    void on_webView_loadProgress(int progress);

    void on_webView_statusBarMessage(const QString &text);
    void on_printAction_triggered();
    void downloadRequested(QNetworkRequest request);

    void on_webview_closeWindowRequest();

};

#endif // EQIBWEBPAGE_H
